package com.example.java_chatroom.service;

import com.example.java_chatroom.mapper.UserMapper;
import com.example.java_chatroom.model.User;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Resource
    UserMapper userMapper;
    public int insert(User user){
        return userMapper.insert(user);
    };

    //根据用户名查询用户信息->登录
    public User selectByName(String username){
        return userMapper.selectByName(username);
    }

}
